package com.zhudoo.zhilian.dao.repository;

import com.zhudoo.zhilian.dao.entity.Appointment;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * @author zhudao
 */
@Repository
public interface AppointmentRepository extends JpaRepository<Appointment, Serializable> {

    List<Appointment> findAllByUserIdAndStatusIn(Integer userId, Set<Integer> status, Pageable pageable);

    List<Appointment> findAllByToUserIdAndStatusIn(Integer userId, Set<Integer> status, Pageable pageable);

    Appointment findByUserIdAndToUserIdAndStatusIn(Integer userId, Integer toUserId, Set<Integer> status);

    Appointment findByOnlyStr(String onlyStr);
}
